<?php

/***************************************************************
**                Linux Vod@home Streaming Server             ** 
****************************************************************

   Written by Nicolas VOISIN Aka DaNifty

****************************************************************/

include_once("./head.inc.php");
if (!file_exists('/media/'.$_SERVER['REMOTE_ADDR'])) $cmd[]="mkdir \"/var/www/www/streaming_engine/temp/".$_SERVER['REMOTE_ADDR']."\"";
$cmd[]="sudo -u root \"mount -t cifs //".$_SERVER['REMOTE_ADDR']."/FILMS /var/www/www/streaming_engine/temp/".$_SERVER['REMOTE_ADDR']."\"";

foreach ($cmd as $command) {
	shell_exec($command);
}

$list=directoryToArray($sources[$_GET['path']],true);

?>
<html>
	<HEAD>
		<META HTTP-EQUIV="Expires" CONTENT="0">
		<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
		<META HTTP-EQUIV="cache-control" CONTENT="no-cache">
		<TITLE><?= $message['product'] ?> [ <?= $message['list'] ?>]</TITLE>
		<LINK rel="stylesheet" href="style.css" type="text/css" charset="utf-8"/>
		<SCRIPT type="text/javascript" language="Javascript" src="xml-http.js"></SCRIPT>
		<script type="text/javascript" language="Javascript">
			function stopVideo() {
				document.getElementById('content_video').src='play.php';
			}
		</script>
	</HEAD>
<body>

<UL class="videoList" >
<?php
sort($list);
while (list($key, $val) = each($list))
{
   echo "       <LI OnMouseOver=\"this.className='listItemHover';\" OnMouseOut=\"this.className='listItem';\" class='listItem' title=\"".htmlentities(CleanFileName(basename($val)))."\" onclick=\"parent.mainFrame.document.location ='./play.php?type=stream&quality=high&file=".urlencode($val)."';\">\r\n";
   //echo "               <img src=\"play.png\"/>&nbsp;\r\n";
   $texte=htmlentities(CleanFileName(basename($val)));
   if (strlen($texte)>38) $texte=substr($texte,0,35)."...";
   echo "               ".$texte."\r\n";
   echo "       </LI>\r\n";
}
?>

</UL>

</div>
</body>
</html>